<div class="layui-form" lay-filter="layuiadmin-form-leveladmin" style="padding: 20px 0 0 0;">
  <div class="layui-form-item">
    <label class="layui-form-label">等级名称</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
      <input type="text" name="pidh" value="{{ d.params.levelName || '' }}" placeholder="请输入部门等级" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">排序</label>
    <div class="layui-input-inline">
      <input type="number" name="level_order" value="{{ d.params.level_order || '' }}" placeholder="请输入排序值" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item" lay-filter="status">
    <label class="layui-form-label">选择状态</label>
    <div class="layui-input-block">
      <script type="text/html" template>
        <input type="radio" name="cflag" value="0" title="启用" checked="checked" {{ d.params.levelFlag === '0' ? 'checked' : '' }}>
        <input type="radio" name="cflag" value="1" title="禁用" {{ d.params.levelFlag === '1' ? 'checked' : '' }}>
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label"></label>
    <div class="layui-input-block">
      <button type="submit" lay-submit lay-filter="LAY-level-front-submit" class="layui-btn">确认</button>
      <button type="button" class="layui-btn layui-btn-primary" id="close-level-form">取消</button>
    </div>
  </div>
</div>

<script>
  layui.use(['admin','form'],function (){
    var $=layui.$
            ,form=layui.form
            ,layer=layui.layer;
    $.ajax({
      url:'/getDeptsServlet'
      ,dataType:'json'
      ,type:'post'
      ,success:function (data){
        $.each(data.data,function (index,value){
          $('#pdnames').append(new Option(value.levelName,value.levelId));
        });
        form.render('select');
      }
    });
  });
</script>